package com.ah.shanxi_demo.sync.utils;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.concurrent.TimeUnit;

/**
 * 描述:
 * 静态常量.
 *
 * @author lenghl
 * @create 2018-06-07 10:16
 */
public class Contants {
    private Contants() {
        throw new IllegalStateException("Utility class");
    }

    /**
     *  工具常量。
     */
    public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();

    /**
     * 告警方式类别.
     */
    public static final String ALERT_EMAIL_TYPE = "email";
    public static final String ALERT_SMS_TYPE = "sms";
    public static final String ALERT_DING_TYPE = "dingtalk";

    /**
     * 线程池。
     */
    public static final int COMMON_MIN_THREAD_SIZE = 1;
    public static final int COMMON_MAX_THREAD_SIZE = 20;
    public static final int COMMON_THREAD_TIME = 5 * 60;
    public static final TimeUnit COMMON_THREAD_TIMEUNIT = TimeUnit.SECONDS;
    public static final int COMMON_QUEUE_SIZE = 500;


    /**
     * 时间.
     */
    public static final long MS_PER_SECOND = 1000;
    public static final long MS_PER_TEN_SECOND = 10 * MS_PER_SECOND;
    public static final long SECOND_PER_HALF_MINUTE = 30;
    public static final long SECOND_PER_MINUTE = 60;
    public static final long MINUTE_PER_HOUR = 60;
    public static final long MS_PER_MINUTE = SECOND_PER_MINUTE * MS_PER_SECOND;
    public static final long MS_PER_HALF_MINUTE = SECOND_PER_HALF_MINUTE * MS_PER_SECOND;
    public static final long MS_PER_HOUR = MINUTE_PER_HOUR * SECOND_PER_MINUTE * MS_PER_SECOND;
    public static final long HOUR_PER_HALF_DAY = 12;
    public static final long MS_PER_HALF_DAY = HOUR_PER_HALF_DAY * MS_PER_HOUR;
    public static final long HOUR_PER_DAY = 24;
    public static final long MS_PER_DAY = HOUR_PER_DAY * MS_PER_HOUR;
    public static final long DAY_PER_WEEK = 7;
    public static final long MS_PER_WEEK = DAY_PER_WEEK * MS_PER_DAY;
    public static final long DAY_PER_MONTH = 30;
    public static final long MS_PER_MONTH = DAY_PER_MONTH * MS_PER_DAY;
    public static final long MONTH_PER_YEER = 12;
    public static final long MS_PER_YEER = MONTH_PER_YEER * MS_PER_MONTH;

    /**
     * 告警邮件内容分隔符.
     */
    public static final String ALERT_EMAIL_CONTENT_LINE_DELIMITER = "#$]";

    /**
     * 告警攻击链所有.
     */
    public static final String ALERT_KILLCHAIN_ALL = "ALL";

    /**
     * 告警ip所有.
     */
    public static final String ALERT_IP_ALL = "ALL";

    public static final Integer EVENTIDS_NUM_LIMIT = 100;

    public static String ALERT_KILLCHAIN_FORMAT = "【%s】【%s】";

    /**
     * 短信服务, 发送成功的统一状态码.
     */
    public static final String SMS_SUCCESS = "200";

    /**
     * 自定义请求执行状态编码.
     */
    public static final Integer CODE_FAILURE = -1;
    public static final Integer CODE_SUCCESS = 0;

    /** 预警 */
    public static final String PREDICT = "predict";
    /** 工单 */
    public static final String ORDER = "order";

}
